package com.kaifamiao.jsp;

import java.time.LocalDate;

// 字段(field) 和 属性(property) 是两码事儿
public class Student {

    // 字段(field): 是在类体中定义的用来存储数据的变量(包括类变量和实例变量)
    private Integer studentId ;
    private String studentName ;
    private String studentGender ;
    private LocalDate studentBirthdate ;

    public Student() {
    }

    public Student(Integer id, String name, String gender, LocalDate bithdate ) {
        this.studentId = id;
        this.studentName = name;
        this.studentGender = gender;
        this.studentBirthdate = bithdate;
    }

    // 属性的前两个字母要大写都大写要小写都小写
    // 属性: getId() --剔除get和参数部分--> Id --首字母变小写--> id (属性)
    public Integer getId() {
        System.out.println( "获取学生实例的id属性值" );
        return studentId;
    }

    // 属性: setId() --剔除set和参数部分--> Id --首字母变小写--> id (属性)
    public void setId(Integer id) {
        this.studentId = id;
    }

    public String getName() {
        System.out.println( "获取学生实例的name属性值" );
        return studentName;
    }

    public void setName(String name) {
        this.studentName = name;
    }

    public String getGender() {
        return studentGender;
    }

    public void setGender(String gender) {
        this.studentGender = gender;
    }

    public LocalDate getBirthdate() {
        return studentBirthdate;
    }

    public void setBirthdate(LocalDate birthdate) {
        this.studentBirthdate = birthdate;
    }

}
